define(function(require) {
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
	var Model = function() {
		this.callParent();
	};
	Model.prototype.modelLoad = function(event) {
		console.log("modelLoad()");
		var data = {};
		data.action = window.app.UserCJApi_ret.Conn;
		var api_url = window.app.base_url + window.app.CodeUrlApi;
		$.ajax({
			type : "POST",
			url : require.toUrl(api_url),
			data : {
				'data' : JSON.stringify(data)
			},
			dataType : 'json',
			success : function(res) {
				console.log(res);
				window.app.LargebagUrl = res[0].LargebagUrl;
				window.app.PouchUrl = res[0].PouchUrl;
				console.log(window.app);
				return;
			},
			error : function(err) {
				console.log(err);
				return;
			}
		});
	};
	Model.prototype.SaleBtnClick = function(event) {
		this.comp("TaskListContainer").load("Factory/Warehouse/TaskList_Sale.w");
		this.comp("FactoryContents").to("TaskListContent");
	};
	Model.prototype.AllotBtnClick = function(event) {
		this.comp("TaskListContainer").load("Factory/Warehouse/TaskList_Allot.w");
		this.comp("FactoryContents").to("TaskListContent");
	};
	Model.prototype.TuihuoBtnClick = function(event) {
		this.comp("TaskListContainer").load("Factory/Warehouse/TaskList_Tuihuo.w");
		this.comp("FactoryContents").to("TaskListContent");
	};
	Model.prototype.ExitBtnClick = function(event) {
		justep.Shell.showPage("TypeSelect");
	};
	return Model;
});